@extends('default.layouts.posts')

@section('sidebar')
    @parent
    @if(!empty($detail['sectionList']))
    <ul class="list-group">
        <li class="list-group-item active"> {{ $detail['bookInfo']['book_name'] }}  </li>
        @foreach ($detail['sectionList'] as $rows)
            <li class="list-group-item">
                <a href="/jiaocheng/chapter-{{ $rows['book_id'] }}-{{$rows['id']}}">
                @if($rows['book_id'] == $bookId && $rows['id'] == $sectionId)
                    <strong> {{ $rows['title'] }} </strong>
                @else
                    <span> {{ $rows['title'] }} </span>
                @endif
            </li>
        @endforeach
    </ul>
    @endif
@endsection

@section('content')

    <ol class="breadcrumb">
      <li><a href="/">首页</a></li>
      <li><a href="/jiaocheng/list" class="active">教程列表</a></li>
      <li><a href="" class="active"> {{ $detail['bookInfo']['book_name'] }} </a> </li>
    </ol>

    @if ($detail)
    <div class="panel panel-default">
          <div class="panel-heading">
                <a href="/jiaocheng/chapter-{{ $detail['bookInfo']['id'] }}-{{ $detail['sectionInfo']['id'] }}"> 
                
                {!! $detail['sectionInfo']['title'] !!}
                </a>
          </div>
          <div class="panel-body">
                
                <!--{!! $detail['bookInfo']['book_description'] !!}-->

                

                {!! $detail['textInfo']['content'] !!}

                <hr />
                <p> Last updated: {{ $detail['textInfo']['created_at'] }}<p>

          </div>
    </div>
    @endif


@endsection